/**
 * 
 */
package com.gr.staffpm.widget.dialog.feedback.model;

import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.model.IModel;


/**
 * @author Graham Rhodes 14 Feb 2011 17:55:36
 */
public class ResetRatingLink extends Link<RatingModel> {

    private static final long serialVersionUID = 1L;

    /**
     * Constructor.
     * 
     * @param id
     *            component id
     * @param object
     *            the model to reset.
     */
    public ResetRatingLink(String id, IModel<RatingModel> object) {
        super(id, object);
    }

    /**
     * @see Link#onClick()
     */
    @Override
    public void onClick() {
        RatingModel rating = getModelObject();
        rating.setNrOfVotes(0);
        rating.setRating(0);
        rating.setSumOfRatings(0);
    }
}
